<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{
        margin: 0;
        padding: 0;
    }

    .box div{
        width: 100px;
        height: 60px;
        line-height: 60px;
        text-align: center;
        border: 1px solid #000000;
        margin-left: 400px;
        float: left;
    }

    .Red{
        background-color: #ff0000;
        height: 200px;
    }

    .Blue{
        background-color: #0000ff;
        height: 200px;
    }

    .Green{
        background-color: #00ff00;
        height: 200px;
    }
    </style>

    <script type="text/javascript">
    window.onload=function(){
        var Para=document.getElementById("Box");

        function a(){
            Para.style.backgroundColor="#ff0000";
        }
    }
    </script>
</head>
<body>
    <div>
        <div class="Box">
            <div class="box">
                <div onclick="a()">变为红色</div>
                <div id="blue">变为蓝色</div>
                <div id="green">变为绿色</div>
            </div>
        </div>
    </div>
</body>
</html>